The terms “storage” and “memory” are generally understood to refer to or to describe those elements of a computer system that retain information. “Physical memory” generally describes high-speed, relatively expensive devices having a relatively small capacity that are typically (but not always) volatile. In contrast, “storage” refers to devices that are typically slower, less expensive (per unit capacity) and have larger capacity than memory devices, and are generally non-volatile. The term “memory” is also commonly used to refer to computing system resources that are utilized in the same manner as, or for similar functions to, physical memory.
In general, in a virtual memory system, the operating system manages memory as a resource, providing a virtual or idealized view of memory to the non-system level software, for example a user program. In this manner, the user program may be isolated from the myriad physical details of the actual memory implementation, and allows an operating system to better utilize scarce computer system resources.
Consequently, when a user program accesses “memory,” the operating system translates the request from a virtual address to a physical address, which is mapped to physical memory. Additionally, in many virtual memory systems, all virtual memory addresses may not directly translate to physical memory, but may translate to storage as well. The operating system may present a virtual image of memory that is larger than the physical memory. The operating system typically will divide memory, both physical and virtual, into pages. Through a process known as paging, the operating system may move virtual pages in and out of physical memory, generally storing pages taken out of physical memory to a storage device. Consequently, the virtual memory system takes on the complexity of managing an effectively unlimited amount of virtual memory, simplifying and enabling user software to use large amounts of virtual memory when necessary.
For the most part, a program, or program segment, must be located in physical memory in order to execute. Copying information from storage into physical memory is a very slow process in comparison to accessing information from physical memory. Consequently, it is highly desirable to have information, e.g., computer instructions, application data and other information, available in physical memory when needed. However, physical memory is typically a limited resource, and it is common for active processes in a computer system to demand, in aggregate, more virtual memory than is available in the form of physical memory on the computer system.
A request, e.g., from a computer program, for more physical memory than is currently available, is generally referred to as “over committing,” or an “overcommit.” In response to an overcommit, a virtual memory system will typically select a portion of physical memory utilized by one or more other workloads or processes, e.g., a number of pages, to copy or “page out” to storage, freeing physical memory for the requestor that initiated the overcommit.
The term “workload” is generally used to refer to or to describe a process, or group of processes, assigned a common set of computing resources, e.g., a set of physical and/or virtual memory pages. A workload can correspond to a single user in a multi-user system. A workload can correspond to an application program. Child processes are generally in the same workload as the spawning process. Elements of a workload are typically related, e.g., application programs and other processes acting upon a common database, but they need not be.
When total physical memory requirements exceed the amount of physical memory available on a computer system, a typical operating system response is to copy some portion of physical memory to storage, thus freeing up the previously used physical memory for another use. This process is generally known as paging, or paging out memory. A computer process losing physical memory due to such paging is often referred to as a “victim” or victim process, and is said to be “victimized” by the paging.
The selection of which workload memory elements resident in physical memory, typically referred to as pages, should be paged, and consequently which processes or workloads are victimized, can have great implications on the performance of a computer system. As such, there has been a great deal of effort devoted to improving selection methods and there are numerous implementations of such methods. A first conventional method for selecting memory to be paged out comprises an operating system selecting least recently used page(s) of memory from throughout the entire computer system.
Other conventional methods of selecting pages for paging set limits on the amount of physical memory allocated to each workload. Such methods attempt to victimize a given workload when it exceeds its physical memory allocation. One conventional method in this category halts execution of a workload when it exceeds its memory allocation. Over time, the physical memory assigned to the workload will become the least recently used memory in the system, the pages will be paged out and the memory assigned to the workload will be “flushed” out. Eventually, the workload begins to be paged back in.
Another conventional method of selecting pages for paging selects pages from a given workload when it exceeds its memory allocation. This method is generally implemented as an operating system kernel process. Operating system kernel processes can be very expensive in terms of computing load on a system, as they execute very frequently in comparison to non-kernel processes. Consequently, it is generally necessary to limit such methods to monitoring a very few processes. In general, all processes of such a system are not monitored for such specific victimization. For example, processes may be combined for the purposes of monitoring and controlling memory usage, in order to limit the number of entities monitored.